package com.ymatou.iapi.login.service;

import org.json.JSONObject;

import com.ymatou.iapi.login.parameter.LoginResult;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*第三方联合登录Call
*FreeMaker Template自动生成代码
*/
public class GetUserLoginLogsCall extends YmatouBaseCall{
	private static String opurl ="api/GetUserLoginLogs";
	
	public GetUserLoginLogsCall() {
		super(EnvSetup.getSystemUrl("login_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	/**
	 * 获取操作结果
	 * 
	 * @return String
	 */
	public LoginResult getResult() {
		LoginResult result = null;
		try {
			result =(LoginResult)FormatUtil.GSONToObject(new JSONObject(getReturnData()).get("Result").toString(), LoginResult.class);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
}